<?php
/**
 * Product:     One-Page Checkout Booster
 * Package:     Gold_Gonepage_1.1.1_94708
 * Purchase ID: 9CBm2i1g9YwZZ6QK4IjUneSwxlnJsImwioL1MUWAXd
 * Generated:   2011-07-15 10:07:59
 * File path:   app/design/frontend/base/default/template/gonepage/cart/item/downloadable.phtml
 * Copyright:   (c) 2011 GOLD, Inc.
 */
?>
<?php $_item = $this->getItem()?>
<tr>
    <td><a href="<?php echo $this->getProductUrl() ?>" class="product-image" title="<?php echo $this->htmlEscape($this->getProductName()) ?>"><img src="<?php echo $this->getProductThumbnail()->resize(75); ?>" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /></a></td>
    <td>
        <h2 class="product-name"><a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->htmlEscape($this->getProductName()) ?></a></h2>
        
<?php if(!Mage::helper('gonepage/geditablecart')->isEnabled()): ?>

        <?php if ($_options = $this->getOptionList()):?>
        <dl class="item-options">
            <?php foreach ($_options as $_option) : ?>
            <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
            <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
            <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
                <?php if (isset($_formatedOptionValue['full_view'])): ?>
                <div class="truncated_full_value">
                    <dl class="item-options">
                        <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
                        <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
                    </dl>
                </div>
                <?php endif; ?>
            </dd>
            <?php endforeach; ?>
        </dl>
        <?php endif;?>
        <!-- downloadable -->
        <?php if ($links = $this->getLinks()): ?>
        <dl class="item-options">
            <dt><?php echo $this->getLinksTitle() ?></dt>
            <?php foreach ($links as $link): ?>
                <dd><?php echo $link->getTitle() ?></dd>
            <?php endforeach; ?>
        </dl>
        <?php endif; ?>
        <!-- EOF downloadable -->
        
<?php else: ?>

<fieldset class="product-options" id="product-options-wrapper" style="border:0px; margin:0px; padding:0px; background-color:inherit; ">

    <script type="text/javascript">
    //<![CDATA[

    var optionTextCounter = {
        count : function(field,cntfield,maxlimit){
            if (field.value.length > maxlimit){
                field.value = field.value.substring(0, maxlimit);
            } else {
                cntfield.innerHTML = maxlimit - field.value.length;
            }
        }
    }

    Product.Options<?php echo $_item->getId() ?> = Class.create();
    Product.Options<?php echo $_item->getId() ?>.prototype = {
        initialize : function(config){
            this.config = config;
        },
        reloadPrice : function(){
return '';
        }
    }
    function validateOptionsCallback(elmId, result){
        var container = $(elmId).up('ul.options-list');
        if (result == 'failed') {
            container.removeClassName('validation-passed');
            container.addClassName('validation-failed');
        } else {
            container.removeClassName('validation-failed');
            container.addClassName('validation-passed');
        }
    }
    opConfig<?php echo $_item->getId() ?> = new Product.Options<?php echo $_item->getId() ?>(<?php echo $this->getJsonConfig() ?>);
    //]]>
    
</script>    
    
<?php $_options = Mage::helper('core')->decorateArray($this->getOptions()) ?>
<?php if (count($_options)):?>

    <dl>
    <?php foreach($_options as $_option): ?>
        <?php echo $this->getOptionHtml($_option) ?>
    <?php endforeach; ?>
    </dl>
<?php endif; ?>

</fieldset>

<?php if ($_item->getItemId()) $iCurrentItemId = $_item->getItemId(); else $iCurrentItemId = uniqid('cart_item'); ?>

<?php $_linksPurchasedSeparately = $this->getLinksPurchasedSeparately() ?>
<?php if ($this->getProduct()->isSaleable() && $this->hasLinks()):?>
    <dl>
        <?php $_links = $this->getLinks(); ?>
        <?php $_isRequired = $this->getLinkSelectionRequired(); ?>
        <dt><label><b><?php echo $this->getLinksTitle() ?><?php if ($_isRequired): ?><span class="required">&nbsp;*</span><?php endif; ?></b></label></dt>
        <dd>
            <ul id="downloadable-links-list" class="options-list"  style="list-style-type:none">
            <?php foreach ($_links as $_link): ?>
                <li>
                    <?php if ($_linksPurchasedSeparately): ?>
                        <input type="checkbox" class="checkbox<?php if($_isRequired):?> validate-one-required-by-name<?php endif; ?> product-downloadable-link" onclick="dConfig.reloadPrice()" name="cart[<?php echo $iCurrentItemId; ?>][downloadable_links][]" id="links_<?php echo $_link->getId() ?>" value="<?php echo $_link->getId() ?>" <?php if ($_link->getIsChecked()) echo 'checked="checked"';?>  />
                    <?php endif; ?>
                    <span class="label">
                        <label for="links_<?php echo $_link->getId() ?>">
                            <?php echo $_link->getTitle() ?>
                        </label>
                            <?php if ($_link->getSampleFile() || $_link->getSampleUrl()): ?>
                                &nbsp;(<a href="<?php echo $this->getLinkSamlpeUrl($_link) ?>" <?php echo $this->getIsOpenInNewWindow()?'onclick="this.target=\'_blank\'"':''; ?>><?php echo Mage::helper('downloadable')->__('sample') ?></a>)
                            <?php endif; ?>
                            <?php if ($_linksPurchasedSeparately): ?>
                                <?php echo $this->getFormattedLinkPrice($_link); ?>
                            <?php endif; ?>
                    </span>
                    <?php if ($_isRequired): ?>
                        <script type="text/javascript">
                            $('links_<?php echo $_link->getId() ?>').advaiceContainer = 'links-advice-container';
                            $('links_<?php echo $_link->getId() ?>').callbackFunction = 'validateDownloadableCallback';
                        </script>
                    <?php endif; ?>
                </li>
            <?php endforeach; ?>
            </ul>

            <?php if ($_isRequired): ?>
                <span id="links-advice-container"></span>
            <?php endif;?>
        </dd>
    </dl>
    <script type="text/javascript">
        Product.Downloadable = Class.create();
        Product.Downloadable.prototype = {
            config : {},
            initialize : function(config){
                this.config = config;
                this.reloadPrice();
            },
            reloadPrice : function(){
                var price = 0;
                config = this.config;
                $$('.product-downloadable-link').each(function(elm){
                    if (config[elm.value] && elm.checked) {
                        price += parseFloat(config[elm.value]);
                    }
                });
                try {
                    var _displayZeroPrice = optionsPrice.displayZeroPrice;
                    optionsPrice.displayZeroPrice = false;
                    optionsPrice.changePrice('downloadable', price);
                    optionsPrice.reload();
                    optionsPrice.displayZeroPrice = _displayZeroPrice;
                } catch (e) {

                }
            }
        };

        function validateDownloadableCallback(elmId, result) {
            var container = $('downloadable-links-list');
            if (result == 'failed') {
                container.removeClassName('validation-passed');
                container.addClassName('validation-failed');
            } else {
                container.removeClassName('validation-failed');
                container.addClassName('validation-passed');
            }
        }

        dConfig = new Product.Downloadable(<?php echo $this->getDownloadableJsonConfig() ?>);
    </script>
<?php endif;?> 

<?php endif; ?>

        <?php if ($messages = $this->getMessages()): ?>
        <?php foreach ($messages as $message): ?>
        <div class="shopping-cart-item-message <?php echo $message['type'] ?>">
            * <?php echo $message['text'] ?>
        </div>
        <?php endforeach; ?>
        <?php endif; ?>
    </td>
    <?php if ($this->helper('gonepage')->canEditCartItems()) : ?>
    <td class="a-center">
        <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo $this->__('Edit item parameters') ?>"><?php echo $this->__('Edit') ?></a>
    </td>
    <?php endif ?>
    <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
    <td class="a-center">
        <button class="button btn-move-to-wishlist" type="button" title="<?php echo $this->__('Move to Wishlist') ?>" value="<?php echo $_item->getId() ?>"><span><span><?php echo $this->__('Move to Wishlist') ?></span></span></button>
        <input id="cart-<?php echo $_item->getId() ?>-wishlist" type="hidden" value="0" name="cart[<?php echo $_item->getId() ?>][wishlist]"/>
    </td>
    <?php endif ?>
    <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
    <td class="a-right">
        <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
            <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
        <?php else: ?>
            <div class="cart-price">
        <?php endif; ?>

            <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
            <?php else: ?>
                <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
            <?php endif; ?>

        </div>


        <?php if (Mage::helper('weee')->getApplied($_item)): ?>

            <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
                <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>

            <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
                    <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
                </div>
            <?php endif; ?>
        <?php endif; ?>
    </td>
    <?php endif; ?>
    <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
    <td>
        <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
        <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
            <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
        <?php else: ?>
            <div class="cart-price">
        <?php endif; ?>

            <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
            <?php else: ?>
                <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
            <?php endif; ?>

        </div>
        <?php if (Mage::helper('weee')->getApplied($_item)): ?>

            <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
                <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>

            <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
                    <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
                </div>
            <?php endif; ?>
        <?php endif; ?>
    </td>
    <?php endif; ?>
    <td class="a-center">
		<div class="qty_box">
			<input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" title="<?php echo $this->__('Qty') ?>" class="input-text qty gitemqty" maxlength="12" />
			<p class="qty_buttons">
				<a class="btn-increase" onclick="return false;" rel="<?php echo $_item->getId() ?>" href="#" title="Increase" alt="Increase"></a>
				<a class="btn-decrease" onclick="return false;" rel="<?php echo $_item->getId() ?>" href="#" title="Decrease" alt="Decrease"></a>
			</p>
		</div>
    </td>
    <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
    <td class="a-right">
        <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
            <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
        <?php else: ?>
            <div class="cart-price">
        <?php endif; ?>

            <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
            <?php else: ?>
                <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
            <?php endif; ?>

        </div>
        <?php if (Mage::helper('weee')->getApplied($_item)): ?>

            <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
                <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>

            <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
                    <span class="weee"><?php echo Mage::helper('weee')->__('Total'); ?>: <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
                </div>
            <?php endif; ?>
        <?php endif; ?>
    </td>
    <?php endif; ?>
    <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
    <td>
        <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
        <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
            <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
        <?php else: ?>
            <div class="cart-price">
        <?php endif; ?>

            <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
            <?php else: ?>
                <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
            <?php endif; ?>

        </div>


        <?php if (Mage::helper('weee')->getApplied($_item)): ?>

            <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display:none;">
                <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                    <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
                        <span class="weee"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>

            <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
                <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
                    <span class="weee"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>: <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
                </div>
            <?php endif; ?>
        <?php endif; ?>
    </td>
    <?php endif; ?>
    <td class="a-center"><a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo $this->__('Remove Item')?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove Item') ?></a></td>
</tr>